{% load pagination_tags %}
{% autopaginate play_books %}
<table class="table table-hover table-bordered ">
            <thead>
            <tr>
                <th>剧本名称</th>
                <th>剧本功能</th>
                <th>系统类型</th>
                <th>版本选择</th>
{#                <th>更新时间</th>#}
                <th>操作</th>
            </tr>
            </thead>
            {% for play_book in play_books %}
                <tr>
                    <td>{{ play_book.name }}</td>
                    <td>
                        {{ play_book.function_name }}
                    </td>
                    <td>{{ play_book.system_type }}</td>
                    <td>
                        <select class="version">
                            {% for file in play_book.playbooksfile_set.all %}
                                <option value="{{ file.id }}">{{ file.version }}</option>
                            {% endfor %}
                        </select>
                    </td>
{#                    <td>{{ play_book.update_time }}</td>#}
                    <td>
{#                        <button class="btn deletebtn btn-default btn-sm"#}
{#                                deleteurl="{% url 'coupon:create' %}">删除#}
{#                        </button>#}
                        <button class="btn btn-default btn-sm run_books"
                                url="{% url 'playbooks:run'%}?pbid={{ play_book.id }}">执行
                        </button>
                        <button class="btn btn-default btn-sm delete_relation"
                                url="{% url 'server:delete_relation'%}?pbid={{ play_book.id }}">取消关联
                        </button>
                    </td>
                </tr>
            {% empty %}
                <tr>
                    <td colspan="8"><p>没有查询到相关信息.</p></td>
                </tr>
            {% endfor %}
        </table>
     {% paginate %}